package org.zerofwk.example.datastruct.linklist;

import java.util.Objects;

class Person {
    private int age;
    private String name;
    private String email;

    public Person(int inAge, String inName, String inEmail) {
        age = inAge;
        name = inName;
        email = inEmail;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return age == person.age;
    }

    @Override
    public int hashCode() {
        return Objects.hash(age);
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age +
                ", name='" + name + '\'' +
                ", email='" + email + '\'' +
                '}';
    }
}
